package com.example.basestationforballonproject;

import java.io.Serializable;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class SharedPreferencesManager implements Serializable{

	private static final long serialVersionUID = 1L;
	private SharedPreferences sharedPreferences;
	public static final String KEY_PHONE_NUMBER = "phoneNumber";

	public SharedPreferencesManager(Context context) {
		this.sharedPreferences =  PreferenceManager.getDefaultSharedPreferences(context);
	}

	public boolean putBoolean(String key, boolean flag) {
		SharedPreferences.Editor editor = this.sharedPreferences.edit();
		editor.putBoolean(key, flag);
		return editor.commit();
	}
	
	public boolean putString(String key, String value) {
		SharedPreferences.Editor editor = this.sharedPreferences.edit();
		editor.putString(key, value);
		return editor.commit();
	}

	public boolean getBoolean(String key) {
		return this.sharedPreferences.getBoolean(key, false);
	}
	
	public String getString(String key) {
		return this.sharedPreferences.getString(key, "null");
	}
}
